1. Field of the Invention
The present invention relates to an improved program development support apparatus and program development support method for supporting the development of a program which includes a main task and a task which interrupts the main task. More particularly, the present invention relates to an apparatus and method suitable for the case of performing testing and debugging for the purpose of creating a concurrent program that has high reliability. Note that, in the present application, "process" is a synonym of "task".
2. Description of Prior Art
In developing a computer program, for frequent interaction with the user and coding processing when an abnormality occurs, it is necessary to code interrupt processing. Interrupt processing is executed when, during execution of the principle processing of the program (called the main task), a specific condition occurs, the main task being temporarily interrupted, during which time separate processing is performed as an interrupt task. After the execution of an interrupt task, there are cases in which the main task is restarted from the point at which it was interrupted, and cases in which it is reperformed from the beginning. There are also cases in which the interrupt task is continued as an another (second) main task without being terminated.
For example, in the program shown in FIG. 28, the interrupt task intr.sub.-- task is a task which performs processing so as to cause an interrupt and, after execution of task job101, cause abnormal termination if an interrupt signal is generated during the execution of the main task shown at the bottom of FIG. 28. The main task is a task that performs the principle processing in the system, this task executing job11 through job15 in the following sequence. Specifically, first job11 is executed, and if the variable flag value is 0, execution is performed in the sequence of job12 followed by job13. If, however, the value of flag is not 0, job14 and then job15 are executed, after which a normal termination is made.
Note that the execution of the command signal (SIGINT, intr task); creates the interrupt-enabled condition, after which the interrupt task is executed when the interrupt signal (SIGINT) is generated. For this reason, if the interrupt signal is generated during the execution of job12, for example, the execution sequence is job11, job12 (until its interruption), and then job101. In general, the interrupt signal can be generated after any executable step within the main task. Therefore, in the program which is shown in FIG. 28, the number of timings of the execution of the interrupt task is the total number of executable steps included in job11 through job15.
In developing a computer program, the detection and correction of bugs in the program, that is, the processing known as debugging, greatly affects the program development efficiency.
In a conventional debugging process, the method employed is to execute a program having a bug one step at a time, and to display the system state after each step is executed, thereby identifying the location at which execution is not performed as intended by the user, this location being the bug location.
However, when debugging a program having interrupt processing, as described above, various processing patterns can occur, depending on the timing at which the interrupt task is executed. Therefore, with the prior art method of executing one step at a time and verifying the results, because of the excessive number of execution patterns that are to be verified, a problem existed in terms of difficulty of finding and eliminating all bugs.
When actually executing a program, it is rare to have the interrupt task executed at every timing, it often being the case that it is sufficient to execute the interrupt task at a certain appropriate timing. Therefore, a method is desired in which the case in which the interrupt task is executed at this appropriate timing is that in which there is no bug, with the interrupt task not being executed at other timings when there is a possibility of a bug occurring.
A concurrent program one in which a plurality of processes are executed simultaneously in concurrent. The development of a concurrent program is more difficult than that of a sequential program, and in particular with testing and debugging methods of the past, because of the indeterminate behavior of a concurrent program, there are problems of an explosive increase in the number of test cases and a lack of bug repeatability, this making the process an extremely difficult one. With regard to interrupt processing in particular, whereas in the past a programmer would clearly code an "interrupt disabling part" into a program, because a determination of whether or not the "interrupt disabling part" has a omission requires a view of the overall program, bugs occurred because of omission in this "interrupt disabling part."
A known technology for improving a method of concurrent program development is hyper-sequential programming (as described in Japanese patent application H6-114668). Hyper-sequential programming removes all indeterminacy from a concurrent program and debugs the program in a sequentialized state, and then re-inserts favorable indeterminacies and harmless indeterminacies into the program to restore the concurrent program.
In hyper-sequential programming, the source code for each process is divided into sections which are units that are execution-controllable, dependency relationships between sections being detected. Then, every execution sequence between sections is expressed as, for example, a network structure state transition diagram (scenario). In the scenario, each state is shown at a nodes which represent all sections that can be executed from that state extending from the node to the next state. In the case in which a particular combination of commands would form separate paths, depending upon the sequence thereof, the paths merge at a node. In a scenario such as this, in which branching of sections have a dependency relationship, a harmful indeterminacy is eliminated by selecting the branching of a section to be executed first and deleting the others. For a branch in which either may be executed first, by leaving both, a favorable indeterminacy or harmless indeterminacy is maintained.
In the above-noted kind of hyper-sequential programming, by controlling the execution sequence so as to suppress a harmful indeterminacy while leaving harmless or favorable indeterminacy, it is possible to gain the advantage of flexibility provided by concurrent programming.
However, because prior art hyper-sequential programming was chiefly directed at concurrent programming for concurrent-processing computers and was not for the purpose of programming interrupt processing, which is characteristic of microcomputers used for control applications, there was a desire to develop a technique which is suitable for the programming of interrupt processing.
The present invention was proposed for the purpose of resolving the above-noted drawbacks in the prior art, and has as an object the efficient support of the development of highly reliable programs. Another object of the present invention is the creation of a highly reliable concurrent program by specifying a part of a concurrent program in which interruption is possible. Yet another object of the present invention is to reduce omissions in the interruptable part by automatically extending the part in which interruption is possible.
Another object of the present invention is to facilitate the understanding of the contents of a concurrent program, using a scenario such as is used in hyper-sequential programming. Yet another object of the present invention is to improve the efficiency of development of a concurrent program by easy creation of a scenario which represents the desirable behavior of the concurrent program.
Another object of the present invention is to extract and detect from a concurrent program dependency relationships and precedence constraints, enabling extension of the interruptable range based on the results thereof. Yet another object of the present invention is to improve the precision of a concurrent program, even in the case in which an inhibit-enabled part is specified, as in the past.